/**
* testing jpush for eam app
*/
var JPush = require("jpush-sdk");
var client = JPush.buildClient('5a506fb358277e1fc33c6775', '50941c5b9d895829d0f56648');

// https://github.com/jpush/jpush-api-nodejs-client
client.push().setPlatform('android')
    .setAudience(JPush.ALL)
    .setNotification('Hi, JPush', JPush.ios('ios alert', 'happy', 5))
    .setMessage('hi, JPush', 'title', 'content-type', {
        foo: 'bar'
    })
    .send(function(err, res) {
        if (err) {
            console.log(err.message);
        } else {
            console.log('Sendno: ' + res.sendno);
            console.log('Msg_id: ' + res.msg_id);
        }
    });
